package Java通配符;


import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;

public class Father {
    public void doSomething() {
        System.out.println("hello");
    }
    public static void main(String[] args) {
        Father father = new Father();
        father.doSomething();
        List a1 = new ArrayList<>();
        a1.add(new Object());
        a1.add(new Integer(111));
        a1.add(new String("hello world"));
        List<?  super Number> a4 = a1;
        a1.remove(0);
        a4.clear();
        a4.add(new Integer(1));
        Object object = a4.get(0);
        List<Integer> intList = new ArrayList<>(10);
        ConcurrentHashMap<String, String> map = new ConcurrentHashMap<>();
//        map.put(null, null);
        TreeMap<String, String> map1 = new TreeMap<>(new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                return -1;
            }
        });
        map1.put("1", "1");
        map1.put("1", "2");
        System.out.println(map1.entrySet());
    }


}